
<?php
define('DB_NAMA', 'sipkandb_dev');
define('DB_USER', 'root');
define('DB_PASSWORD', 'bismillah');
define('DB_HOST', 'localhost');

function koneksi_buka() {
	mysql_select_db(DB_NAMA,mysql_connect(DB_HOST,DB_USER,DB_PASSWORD));
}

function koneksi_tutup() {
	mysql_close(mysql_connect(DB_HOST,DB_USER,DB_PASSWORD));
}

$kd_perkara = $_POST['kd'];

koneksi_buka();
$perkara=mysql_query("SELECT * FROM t_p16_jaksa WHERE kd_perkara='".$kd_perkara."'");
while($dt = mysql_fetch_array($perkara)) {
	mysql_query("INSERT INTO t_sms VALUE('','4','".$dt[1]."','".$dt[0]."','0')");
}
koneksi_tutup();
?>
